import java.util.ArrayList;

import uchicago.src.sim.space.Multi2DGrid;
import uchicago.src.sim.space.Multi2DHexagonalGrid;


public class Team {

	
	private int id;
	private int foco;
	private ArrayList<BombeiroAgent> bombeiros;
	private Multi2DGrid space;
	private ArrayList<Object> cellList;
	
	
	
	
	public Team(int id,int nbombeiros,Multi2DGrid space, ArrayList<Object> cellList, int f)
	{
		this.id=id;
		this.space=space;
		this.cellList = cellList;
		bombeiros = new ArrayList<BombeiroAgent>();
		foco = f;
		
		
		
		for (int i=0;i<nbombeiros;i++) 
		{
			bombeiros.add(new BombeiroAgent(i,space,id, foco));
		}
	}
	
	// ter cuidado com as fronteiras do space
	public void setPositions(int x,int y)
	{
		int count=0;
		
		for(int i=0; i<10 && count<bombeiros.size();i++)
		{
			for(int j=0;j<3  && count<bombeiros.size();j++)
			{
				BombeiroAgent b = bombeiros.get(count);
				b.setX(x+i);
				b.setY(y+j); 
				
				space.putObjectAt(b.getX(),b.getY(), b);
				cellList.add(b);
				
				count++;
				
			}
		}
	}
		
	public void setGoal(int x, int y){
		for(int i = 0; i < bombeiros.size();i++){
			BombeiroAgent b = bombeiros.get(i);
			b.setObjectiveX(x);
			b.setObjectiveY(y);
			
		}
	}

	public ArrayList<BombeiroAgent> getBombeiros() {
		// TODO Auto-generated method stub
		return bombeiros;
	}
		
	public int getFoco(){
		return foco;
	}
	
	public void setFoco(int f){
		this.foco = f;
	}
		
	public int getId(){
		return id;
	}
	
		
		
		
	
	
}
